
from Page.Page1 import Page1
from selenium.webdriver.common.by import By
import time


class Page2(Page1):



    # 点击店铺列表
    click_dp_loc = (By.XPATH, '/html/body/div[1]/div/section/aside/ul/li[1]/ul/li[5]')
    def click_dp(self):
        self.click(self.click_dp_loc)

    # 点击输入店铺名（模糊搜索）
    send_dpname_loc = (By.XPATH, '/html/body/div[1]/div/section/section/main/form/div/div[2]/div/div/div/div/input')
    def send_dpname(self):
        self.send_keys(self.send_dpname_loc, '蜜雪')

    # 点击搜索按钮
    click_ss_button_loc = (By.XPATH, '/html/body/div[1]/div/section/section/main/form/div/div[4]/div/div/button[1]/span')
    def click_ss_button(self):
        self.click(self.click_ss_button_loc)


    # 点击下拉框
    click_xlk_loc = (By.XPATH,
                     '/html/body/div[1]/div/section/section/main/form/div/div[3]/div/div/div/div/div[1]/div[2]')
    def click_xlk(self):
        self.click(self.click_xlk_loc)

    # 点击选择地址
    click_xz_address_loc = (By.XPATH, '/html/body/div[1]/div/section/section/main/form/div/div[3]/div/div/div/div/div[1]/div[2]')
    def click_xz_address(self):
        self.click(self.click_xz_address_loc)


    # 业务逻辑
    def seatch_luoji_01(self):
        self.Item_user_login('zhangsan', '123456Aa')
        self.click_dp()
        time.sleep(2)
        self.send_dpname()
        self.click_ss_button()
        time.sleep(3)
        self.click_xlk()
        self.click_xz_address()
        self.click_ss_button()
        time.sleep(3)





